<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        //发送 AJAX 请求, 返回的结果是Promise 对象;
        function sendAJAX  (url){
            //1.创建对象;
            const x = new XMLHttpRequest();

            //2.初始化
            x.open('GET',url);

            //3.发送
            x.send();

            //4.事件绑定;
            x.onreadystatechange = function(){
                if(x.readyState == 4){
                    if(x.status >= 200 && x.status < 300){
                        
                    }
                }
            }
        }
    </script>
</body>
</html>